//========================================================================
//  SE5 Empire Setup - Sithrak - Captain Kwok's Balance Mod v125+
//========================================================================
//
// Sithrak Dominion
// Rock + Oxygen, Tyranny, Berserkers
//

#include Script_AI_GlobalResearch.txt

//------------------------------------------------------------------------
// Global Constants
//------------------------------------------------------------------------

//------------------------------------------------------------------------
// Global Variables
//------------------------------------------------------------------------

//------------------------------------------------------------------------
// Forward Declarations
//------------------------------------------------------------------------

//------------------------------------------------------------------------
// Main
//------------------------------------------------------------------------
function Main returns boolean
vars
  racial_pts:                long
  research_pts:              long
begin

  // Get our racial trait and starting research points
  set racial_pts := Sys_AI_Setup_Get_Racial_Points_Remaining(sys_long_Player_ID)
  set research_pts := Sys_AI_Setup_Get_Research_Points_Remaining(sys_long_Player_ID)

  // Sithrak setup preferences
  set bool_Race_Uses_Mines                                 := TRUE
  set bool_Race_Uses_Fighters                              := TRUE
  set bool_Race_Uses_Satellites                            := TRUE
  set bool_Race_Uses_Troops                                := TRUE
  set bool_Race_Uses_Weapon_Platforms                      := TRUE
  set bool_Race_Uses_Drones                                := TRUE
  set bool_Race_Uses_Kamikaze_Ships                        := TRUE
  set bool_Race_Uses_Boarding_Ships                        := FALSE
  set bool_Race_Uses_Bombardment_Ships                     := FALSE
  set bool_Race_Uses_Normal_Armor                          := TRUE
  set bool_Race_Uses_Normal_Shields                        := TRUE
  set bool_Race_Uses_Cloaking_Devices                      := TRUE
  set bool_Race_Uses_Master_Computers                      := TRUE

  set bool_Race_Uses_Interdimensional_Tech                 := TRUE
  set bool_Race_Uses_Interdimensional_Weapons              := TRUE

  set bool_Race_Uses_Plasma_Missile_Weapons                := TRUE
  set bool_Race_Uses_Tractor_Repulser_Weapons              := TRUE
  set bool_Race_Uses_Biological_Weapons                    := TRUE

  // Debug output
  call Sys_Debug_Print("Setup", "------------------------")
  call Sys_Debug_Print("Setup", "Racial Trait Selections:")
  call Sys_Debug_Print("Setup", "  - Starting Points = " + Sys_Convert_Long_To_String(racial_pts))

  // AI Assist
  if Sys_Are_We_Computer_Player(sys_long_Player_ID) then
    call Add_Racial_Trait("AI Assist") // 0
  endif

  // Sithrak Racial Traits
  // 2000 Pts
  call Add_Racial_Trait("Interdimensional Knowledge") // 1,500
  call Add_Racial_Trait("Low Reproduction") // -500
  call Add_Racial_Trait("Farming Ineptness") // -500
  call Add_Racial_Trait("Propulsion Experts") // 1,000
  call Add_Racial_Trait("Naturally Happy") // 500
  // 3000 Pts
  call Add_Racial_Trait("Bunglers") // -500
  call Add_Racial_Trait("Ancient Race") // 1,500
  // 5000 Pts
  call Add_Racial_Trait("Physical Strength") // 500
  call Add_Racial_Trait("Brave") // 500
  call Add_Racial_Trait("Advanced Power Conservation") // 1,000

  // Debug output
  call Sys_Debug_Print("Setup", "----------------------")
  call Sys_Debug_Print("Setup", "Technology Selections:")
  call Sys_Debug_Print("Setup", "  - Starting Points = " + Sys_Convert_Long_To_String(research_pts))

  // Sithrak starting technologies

  // Sithrak low tech start (5,000 Default)
  if (research_pts > 0) and (research_pts <= 5000) then
    call Add_Tech_Area("Sensors", 3, TRUE, FALSE) // 50,000
  endif

  // Sithrak medium tech start (50,000 Default; 25,000 = High Cost; 100,000 = Low Cost)
  if (research_pts > 5000) and (research_pts <= 100000) then
    call Add_Tech_Area("Physics", 2, TRUE, FALSE) // 12,000
    // Sub-Total 12,000 (12,000)
    call Add_Tech_Area("Armor", 2, TRUE, FALSE) // 2,000
    call Add_Tech_Area("Shields", 1, TRUE, FALSE) // 2,000
    call Add_Tech_Area("Sensors", 4, TRUE, FALSE) // 9,000
    // Sub-Total 13,000 (25,000)
    call Add_Tech_Area("Interdimensional Technology", 2, bool_Race_Uses_Interdimensional_Tech, FALSE) // 6,000
    call Add_Tech_Area("Interdimensional Weapons", 3, bool_Race_Uses_Interdimensional_Weapons, FALSE) // 15,000
    // Sub-Total 21,000 (46,000)
    call Add_Tech_Area("Point-Defense Weapons", 2, TRUE, FALSE) // 4,000
    // Sub-Total 4,000 (50,000)
    call Add_Tech_Area("Construction", 2, TRUE, FALSE) // 12,000
    // Sub-Total 12,000 (62,000)
    call Add_Tech_Area("Small Ship Construction", 3, TRUE, FALSE) // 10,000
    call Add_Tech_Area("Medium Ship Construction", 1, TRUE, FALSE) // 6,000
    call Add_Tech_Area("Troops", 3, TRUE, FALSE) // 5,000
    call Add_Tech_Area("Mines", 1, TRUE, FALSE) // 4,000
    call Add_Tech_Area("Ion Engines", 3, TRUE, FALSE) // 10,000
    call Add_Tech_Area("Armor", 3, TRUE, FALSE) // 3,000
    // Sub-Total 38,000 (100,000)
  endif

  // Sithrak high tech start (500,000 Default; 250,000 = High Cost; 1,000,000 = Low Cost)
  if (research_pts > 100000) then
    call Add_Tech_Area("Ice Planet Colonization", 1, TRUE, FALSE) // 50,000
    call Add_Tech_Area("Gas Giant Colonization", 1, TRUE, FALSE) // 50,000
    // Sub-Total 100,000
    call Add_Tech_Area("Interdimensional Technology", 3, bool_Race_Uses_Interdimensional_Tech, FALSE) // 15,000
    call Add_Tech_Area("Interdimensional Weapons", 3, bool_Race_Uses_Interdimensional_Weapons, FALSE) // 15,000
    // Sub-Total 30,000 (130,000)
    call Add_Tech_Area("Astrophysics", 2, TRUE, FALSE) // 12,000
    call Add_Tech_Area("Biology", 2, TRUE, FALSE) // 6,000
    call Add_Tech_Area("Construction", 2, TRUE, FALSE) // 12,000
    call Add_Tech_Area("Military Science", 2, TRUE, FALSE) // 10,000
    call Add_Tech_Area("Physics", 2, TRUE, FALSE) // 12,000
    // Sub-Total 52,000 (182,000)
    call Add_Tech_Area("Small Ship Construction", 3, TRUE, FALSE) // 10,000
    call Add_Tech_Area("Medium Ship Construction", 1, TRUE, FALSE) // 6,000
    call Add_Tech_Area("Mines", 1, TRUE, FALSE) // 4,000
    call Add_Tech_Area("Ion Engines", 3, TRUE, FALSE) // 10,000
    call Add_Tech_Area("Armor", 3, TRUE, FALSE) // 5,000
    call Add_Tech_Area("Shields", 3, TRUE, FALSE) // 12,000
    call Add_Tech_Area("Sensors", 4, TRUE, FALSE) // 9,000
    call Add_Tech_Area("Defense Systems", 2, TRUE, FALSE) // 6,000
    // Sub-Total 62,000 (244,000)
    call Add_Tech_Area("Point-Defense Weapons", 2, TRUE, FALSE) // 4,000
    call Add_Tech_Area("Tractor\Repulser Weapons", 1, bool_Race_Uses_Tractor_Repulser_Weapons, FALSE) // 1,000
    call Add_Tech_Area("Biological Weapons", 1, bool_Race_Uses_Biological_Weapons, FALSE) // 1,000
    // Sub-Total 6,000 (250,000)
    call Add_Tech_Area("Interdimensional Technology", 5, bool_Race_Uses_Interdimensional_Tech, FALSE) // 27,000
    call Add_Tech_Area("Interdimensional Weapons", 4, bool_Race_Uses_Interdimensional_Weapons, FALSE) // 12,000
    // Sub-Total 39,000 (289,000)
    call Add_Tech_Area("Chemistry", 2, TRUE, FALSE) // 12,000
    // Sub-Total 12,000 (301,000)
    call Add_Tech_Area("Repair", 1, TRUE, FALSE) // 1,000
    call Add_Tech_Area("Small Ship Construction", 6, TRUE, FALSE) // 30,000
    call Add_Tech_Area("Medium Ship Construction", 4, TRUE, FALSE) // 54,000
    call Add_Tech_Area("Small Base Construction", 3, TRUE, FALSE) // 15,000
    call Add_Tech_Area("Contra-Terrene Engines", 3, TRUE, FALSE) // 24,000
    call Add_Tech_Area("Applied Research", 2, TRUE, FALSE) // 12,000
    call Add_Tech_Area("Medical Treatment", 1, TRUE, FALSE) // 2,000
    call Add_Tech_Area("Minerals Extraction", 2, TRUE, FALSE) // 8,000
    call Add_Tech_Area("Organics Extraction", 2, TRUE, FALSE) // 4,000
    call Add_Tech_Area("Radioactives Extraction", 2, TRUE, FALSE) // 6,000
    // Sub-Total 156,000 (457,000)
    call Add_Tech_Area("Weapon Mounts", 1, TRUE, FALSE) // 1,000
    call Add_Tech_Area("Ship Weapon Mounts", 5, TRUE, FALSE) // 15,000
    call Add_Tech_Area("Plasma Missile Weapons", 3, bool_Race_Uses_Plasma_Missile_Weapons, FALSE) // 24,000
    call Add_Tech_Area("Ship Capture", 1, TRUE, FALSE) // 1,000
    call Add_Tech_Area("Smaller Weapons", 2, TRUE, FALSE) // 2,000
    // Sub-Total 43,000 (500,000)
    call Add_Tech_Area("Astrophysics", 4, TRUE, FALSE) // 42,000
    call Add_Tech_Area("Chemistry", 3, TRUE, FALSE) // 18,000
    call Add_Tech_Area("Construction", 3, TRUE, FALSE) // 18,000
    call Add_Tech_Area("Industry", 2, TRUE, FALSE) // 10,000
    call Add_Tech_Area("Military Science", 3, TRUE, FALSE) // 15,000
    call Add_Tech_Area("Planetary Engineering", 1, TRUE, FALSE) // 10,000
    call Add_Tech_Area("Psychology", 1, TRUE, FALSE) // 3,000
    // Sub-Total 116,000 (616,000)
    call Add_Tech_Area("Space Yards", 3, TRUE, FALSE) // 20,000
    call Add_Tech_Area("Medium Ship Construction", 9, TRUE, FALSE) // 66,000
    call Add_Tech_Area("Large Ship Construction", 1, TRUE, FALSE) // 10,000
    call Add_Tech_Area("Troops", 3, TRUE, FALSE) // 5,000
    call Add_Tech_Area("Fighters", 3, TRUE, FALSE) // 25,000
    call Add_Tech_Area("Weapon Platforms", 3, TRUE, FALSE) // 30,000
    call Add_Tech_Area("Vehicle Systems", 3, TRUE, FALSE) // 15,000
    call Add_Tech_Area("Gravitational Manipulation", 1, TRUE, FALSE) // 6,000
    call Add_Tech_Area("Jacket-Photon Engines", 1, TRUE, FALSE) // 6,000
    call Add_Tech_Area("Resupply", 3, TRUE, FALSE) // 5,000
    call Add_Tech_Area("Armor", 4, TRUE, FALSE) // 4,000
    call Add_Tech_Area("Shields", 4, TRUE, FALSE) // 8,000
    call Add_Tech_Area("Sensors", 8, TRUE, FALSE) // 26,000
    call Add_Tech_Area("Defense Systems", 3, TRUE, FALSE) // 6,000
    call Add_Tech_Area("Cargo", 4, TRUE, FALSE) // 9,000
    call Add_Tech_Area("Applied Research", 3, TRUE, FALSE) // 18,000
    call Add_Tech_Area("Applied Political Science", 1, TRUE, FALSE) // 3,000
    call Add_Tech_Area("Planet Utilization", 1, TRUE, FALSE) // 2,000
    call Add_Tech_Area("Minerals Extraction", 3, TRUE, FALSE) // 12,000
    call Add_Tech_Area("Radioactives Extraction", 3, TRUE, FALSE) // 9,000
    call Add_Tech_Area("Intelligence Services", 3, bool_Intel_Is_Allowed, FALSE) // 15,000
    // Sub-Total 300,000 (916,000)
    call Add_Tech_Area("Interdimensional Weapons", 6, bool_Race_Uses_Interdimensional_Weapons, FALSE) // 33,000
    call Add_Tech_Area("Unit Weapon Mounts", 3, TRUE, FALSE) // 12,000
    call Add_Tech_Area("Plasma Missile Weapons", 5, bool_Race_Uses_Plasma_Missile_Weapons, FALSE) // 36,000
    call Add_Tech_Area("Ship Capture", 3, not bool_Intel_Is_Allowed, FALSE) // 3,000
    call Add_Tech_Area("Smaller Weapons", 3, TRUE, FALSE) // 3,000
    // Sub-Total 84,000 (1,000,000)
  endif

  // If there are setup points remaining, spend them
  if (Sys_AI_Setup_Get_Research_Points_Remaining(sys_long_Player_ID) > 1000) then
    call AI_Research_Selection()
  endif

  return TRUE
end


//------------------------------------------------------------------------